package com.hbnu.controller;

import com.hbnu.pojo.Goods;
import com.hbnu.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import java.util.List;

@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Autowired //将业务层对象注入到控制层
    private GoodsService goodsService;

    @RequestMapping("/findAll")
    public List<Goods> findAll(){
        return goodsService.findAllGoods();
    }
}




















